package com.bw.controller;

import com.bw.bean.Vo;
import com.bw.service.VoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class VoController {
    @Autowired
    VoService voService;
    //查询订单的总价格，实现翻牌器大屏展示
    @RequestMapping("list1")
    public Map a(){
        Double val=voService.a();
        return SugarUtil.getFlipNumberData(val);
    }
    //查询各货物的销售总额的占比，编写正确sql的语句
    @RequestMapping("list2")
    public Map b(){
        List<Vo> list=voService.b();
        return SugarUtil.getPieData(list);
    }
    //查询各省份的销售总额，编写正确sql的语句
    @RequestMapping("list3")
    public Map c(){
        List<Vo> list=voService.c();
        return SugarUtil.getMapData(list);
    }
}
